package com.br.pfm.persistence.model;

import java.io.Serializable;
import java.util.GregorianCalendar;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

@Entity
@Table(name="PFM_item_fatura")
public class ItemFatura implements Serializable {
	
	private static final long serialVersionUID = 1963029526342510204L;
	
	@Id
	@GeneratedValue
	@Column(name = "id_item_fatura", nullable = false, length = 2)
	private int idItemFatura;
	
	@Getter
    @Setter
	@Column(name = "valor_item_fatura", nullable = false, length = 10)
	private int valorItemFatura;
	
	@Getter
    @Setter
	@Column(name = "valor_terceiro", nullable = false, length = 10)
	private int valorTerceiro;
	
	@Getter
    @Setter
	@Column(name = "dt_origem_compra", nullable = false, length = 10)
	private GregorianCalendar dataOrigemCompra;
	
	@Getter
    @Setter
	@Column(name = "num_parcela", nullable = false, length = 2)
	private int numeroParcela;
	
	@Getter
    @Setter
	@Column(name = "qtd_parcelas", nullable = false, length = 2)
	private int quantidadeParcelas;
	
	@Getter
    @Setter
	@Column(name = "desc_item_fatura", nullable = false)
	private String descItemFatura;
	
	@Getter
    @Setter
	@ManyToOne(cascade=CascadeType.ALL)
    private Fatura fatura;
	
	@Getter
    @Setter
	@ManyToOne(cascade=CascadeType.ALL)
    private ItemFatura itemFatura;
	
	@Getter
    @Setter
	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name="id_categoria", insertable=false, updatable=false)
	private Categoria categoria;

	@Getter
    @Setter
	@ManyToOne(cascade=CascadeType.ALL)
    private Sequencial sequencial;
}
